﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;

namespace vpGrid.Controllers
{
    public class LogController : ApiController
    {
        [Route("api/v1/log/js")]
        [HttpGet]
        public HttpResponseMessage LogJavaScriptException([FromUri]string ex)
        {
            try
            {
                //TODO : store exception in db
                var response = new HttpResponseMessage()
                {
                    StatusCode = HttpStatusCode.OK,
                    Content = new ByteArrayContent(new byte[0])
                };
                response.Content.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("image/png");
                
                return response;
            }
            catch (Exception ex1)
            {
                string msg = ex1.Message;
                //TODO : log in db
                return null;
            }
        }


    }
}